package cn.ztr.ymcc.feign.impl;

import cn.ztr.ymcc.feign.mediaFeign;
import cn.ztr.ymcc.result.JsonResult;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MediaFeignImpl implements FallbackFactory<mediaFeign> {
    @Override
    public mediaFeign create(Throwable throwable) {
        return new mediaFeign() {
            @Override
            public JsonResult getMediaFileByCourseId(Long courseId) {
                return JsonResult.error("获取课程资料失败"+throwable.getMessage());
            }
        };
    }
}
